/** @format */

import React from 'react';
import Login from './login';
import AdminContent from './admin-content';
import {BrowserRouter, Route, Switch} from 'react-router-dom';

interface ILocation {
  key: string;
  [propName: string]: any;
}

interface IProps {
  location: ILocation;
}

class Admin extends React.Component<IProps> {
  constructor(props: IProps) {
    super(props);
  }

  render(): JSX.Element {
    return (
      <BrowserRouter>
        <Switch>
          <Route path="/login" component={Login} />
          <Route path="/" component={AdminContent} />
        </Switch>
      </BrowserRouter>
    );
  }
}

export default Admin;
